﻿using System;
using System.Collections.Generic;
using System.Text;

namespace ConnectionButtons
{
    public class ConnectionButtonsConfig
    {
        public ConnectionButtonsConfig()
        {
            this.Button1Name = string.Empty; this.DataSource1 = string.Empty; this.InitialCatalog1 = string.Empty; this.UserID1 = string.Empty; this.Password1 = string.Empty; this.WindowsAuth1 = false;
            this.Button2Name = string.Empty; this.DataSource2 = string.Empty; this.InitialCatalog2 = string.Empty; this.UserID2 = string.Empty; this.Password2 = string.Empty; this.WindowsAuth2 = false;
            this.Button3Name = string.Empty; this.DataSource3 = string.Empty; this.InitialCatalog3 = string.Empty; this.UserID3 = string.Empty; this.Password3 = string.Empty; this.WindowsAuth3 = false;
            this.Button4Name = string.Empty; this.DataSource4 = string.Empty; this.InitialCatalog4 = string.Empty; this.UserID4 = string.Empty; this.Password4 = string.Empty; this.WindowsAuth4 = false;
            this.Button5Name = string.Empty; this.DataSource5 = string.Empty; this.InitialCatalog5 = string.Empty; this.UserID5 = string.Empty; this.Password5 = string.Empty; this.WindowsAuth5 = false;
            this.Button6Name = string.Empty; this.DataSource6 = string.Empty; this.InitialCatalog6 = string.Empty; this.UserID6 = string.Empty; this.Password6 = string.Empty; this.WindowsAuth6 = false;
            this.Button7Name = string.Empty; this.DataSource7 = string.Empty; this.InitialCatalog7 = string.Empty; this.UserID7 = string.Empty; this.Password7 = string.Empty; this.WindowsAuth7 = false;
            this.Button8Name = string.Empty; this.DataSource8 = string.Empty; this.InitialCatalog8 = string.Empty; this.UserID8 = string.Empty; this.Password8 = string.Empty; this.WindowsAuth8 = false;
            this.Button9Name = string.Empty; this.DataSource9 = string.Empty; this.InitialCatalog9 = string.Empty; this.UserID9 = string.Empty; this.Password9 = string.Empty; this.WindowsAuth9 = false;
            this.Button10Name = string.Empty; this.DataSource10 = string.Empty; this.InitialCatalog10 = string.Empty; this.UserID10 = string.Empty; this.Password10 = string.Empty; this.WindowsAuth10 = false;
        }

        public string Button1Name { get; set; }
        public string DataSource1 { get; set; }
        public string InitialCatalog1 { get; set; }
        public string UserID1 { get; set; }
        public string Password1 { get; set; }
        public bool WindowsAuth1 { get; set; }

        public string Button2Name { get; set; }
        public string DataSource2 { get; set; }
        public string InitialCatalog2 { get; set; }
        public string UserID2 { get; set; }
        public string Password2 { get; set; }
        public bool WindowsAuth2 { get; set; }

        public string Button3Name { get; set; }
        public string DataSource3 { get; set; }
        public string InitialCatalog3 { get; set; }
        public string UserID3 { get; set; }
        public string Password3 { get; set; }
        public bool WindowsAuth3 { get; set; }

        public string Button4Name { get; set; }
        public string DataSource4 { get; set; }
        public string InitialCatalog4 { get; set; }
        public string UserID4 { get; set; }
        public string Password4 { get; set; }
        public bool WindowsAuth4 { get; set; }

        public string Button5Name { get; set; }
        public string DataSource5 { get; set; }
        public string InitialCatalog5 { get; set; }
        public string UserID5 { get; set; }
        public string Password5 { get; set; }
        public bool WindowsAuth5 { get; set; }

        public string Button6Name { get; set; }
        public string DataSource6 { get; set; }
        public string InitialCatalog6 { get; set; }
        public string UserID6 { get; set; }
        public string Password6 { get; set; }
        public bool WindowsAuth6 { get; set; }

        public string Button7Name { get; set; }
        public string DataSource7 { get; set; }
        public string InitialCatalog7 { get; set; }
        public string UserID7 { get; set; }
        public string Password7 { get; set; }
        public bool WindowsAuth7 { get; set; }

        public string Button8Name { get; set; }
        public string DataSource8 { get; set; }
        public string InitialCatalog8 { get; set; }
        public string UserID8 { get; set; }
        public string Password8 { get; set; }
        public bool WindowsAuth8 { get; set; }

        public string Button9Name { get; set; }
        public string DataSource9 { get; set; }
        public string InitialCatalog9 { get; set; }
        public string UserID9 { get; set; }
        public string Password9 { get; set; }
        public bool WindowsAuth9 { get; set; }

        public string Button10Name { get; set; }
        public string DataSource10 { get; set; }
        public string InitialCatalog10 { get; set; }
        public string UserID10 { get; set; }
        public string Password10 { get; set; }
        public bool WindowsAuth10 { get; set; }

        public string GetButtonName(int buttonIndex)
        {
            switch (buttonIndex)
            {
                case 1: return this.Button1Name;
                case 2: return this.Button2Name;
                case 3: return this.Button3Name;
                case 4: return this.Button4Name;
                case 5: return this.Button5Name;
                case 6: return this.Button6Name;
                case 7: return this.Button7Name;
                case 8: return this.Button8Name;
                case 9: return this.Button9Name;
                case 10: return this.Button10Name;
            }
            return string.Empty;
        }

        public string GetDataSource(int buttonIndex)
        {
            switch (buttonIndex)
            {
                case 1: return this.DataSource1;
                case 2: return this.DataSource2;
                case 3: return this.DataSource3;
                case 4: return this.DataSource4;
                case 5: return this.DataSource5;
                case 6: return this.DataSource6;
                case 7: return this.DataSource7;
                case 8: return this.DataSource8;
                case 9: return this.DataSource9;
                case 10: return this.DataSource10;
            }
            return string.Empty;
        }

        public string GetInitialCatalog(int buttonIndex)
        {
            switch (buttonIndex)
            {
                case 1: return this.InitialCatalog1;
                case 2: return this.InitialCatalog2;
                case 3: return this.InitialCatalog3;
                case 4: return this.InitialCatalog4;
                case 5: return this.InitialCatalog5;
                case 6: return this.InitialCatalog6;
                case 7: return this.InitialCatalog7;
                case 8: return this.InitialCatalog8;
                case 9: return this.InitialCatalog9;
                case 10: return this.InitialCatalog10;
            }
            return string.Empty;
        }

        public string GetUserID(int buttonIndex)
        {
            switch (buttonIndex)
            {
                case 1: return this.UserID1;
                case 2: return this.UserID2;
                case 3: return this.UserID3;
                case 4: return this.UserID4;
                case 5: return this.UserID5;
                case 6: return this.UserID6;
                case 7: return this.UserID7;
                case 8: return this.UserID8;
                case 9: return this.UserID9;
                case 10: return this.UserID10;
            }
            return string.Empty;
        }

        public string GetPassword(int buttonIndex)
        {
            switch (buttonIndex)
            {
                case 1: return this.Password1;
                case 2: return this.Password2;
                case 3: return this.Password3;
                case 4: return this.Password4;
                case 5: return this.Password5;
                case 6: return this.Password6;
                case 7: return this.Password7;
                case 8: return this.Password8;
                case 9: return this.Password9;
                case 10: return this.Password10;
            }
            return string.Empty;
        }

        public bool GetWindowsAuth(int buttonIndex)
        {
            switch (buttonIndex)
            {
                case 1: return this.WindowsAuth1;
                case 2: return this.WindowsAuth2;
                case 3: return this.WindowsAuth3;
                case 4: return this.WindowsAuth4;
                case 5: return this.WindowsAuth5;
                case 6: return this.WindowsAuth6;
                case 7: return this.WindowsAuth7;
                case 8: return this.WindowsAuth8;
                case 9: return this.WindowsAuth9;
                case 10: return this.WindowsAuth10;
            }
            return false;
        }
    }
}
